﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SDFL.Utilities
{

    public enum EntryType
    {
        Failure = 0,
        Scenario = 1,
        Standard = 2,
        Verbose = 3
    }    

    /// <summary>
    /// Base class of Log
    /// </summary>
    /// <history>
    ///     [Dylan]     2009-10-19      Created
    /// </history>
    public abstract class LogBase
    {
        protected class Strings
        {
            public const string MRSTALogRegistryAppName  = "MRSTA";
            public const string MRSTALogRegistryKey  = "Log";
            public const string MRSTALogRegistryValue = "Support Directory";
        }

        private bool _verbose;

        public bool Verbose
        {
            get { return _verbose; }
            set { _verbose = value; }
        }

        public LogBase(): this(false)
        {
        }

        public LogBase(bool verbose)
        {
            _verbose = verbose;
            LogManager.AddLog(this);
        }

        public static string DefaultLogFilePath()
        {
            string tmp = string.Empty;

            try
            {
                tmp = "AppLogs.log";
            }
            catch (Exception ex)
            {
                LogManager.LogFailure(ex); 
            }
            return tmp;
        }

        public abstract void WriteEntry(EntryType entryType, string info);

        public abstract void LogFailure(Exception ex, string info, string bugNumber);

        public abstract void LogPass(string info);

        public abstract void LogPass();

        public abstract void InitScenario(string scenarioDescription);

        internal abstract void InitTestCase(string testcaseDescription);
       
    }
}
